package com.esri.core.ags;

import com.esri.core.geometry.Point;
import com.esri.core.geometry.SpatialReference;
import com.esri.core.internal.util.d;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class TileInfo implements Serializable {
    private static final long serialVersionUID = 1;
    protected int cols;
    protected double compressionQuality;
    protected int dpi;
    protected String format;
    protected List<LOD> lods;
    protected Point origin;
    protected int rows;
    protected SpatialReference spatialReference;

    public static long getSerialversionuid() {
        return 1L;
    }

    public int getRows() {
        return this.rows;
    }

    public int getCols() {
        return this.cols;
    }

    public int getDPI() {
        return this.dpi;
    }

    public String getFormat() {
        return this.format;
    }

    public double getCompressionQuality() {
        return this.compressionQuality;
    }

    public Point getOrigin() {
        return this.origin;
    }

    public List<LOD> getLODs() {
        return this.lods;
    }

    public SpatialReference getSpatialReference() {
        return this.spatialReference;
    }

    public static TileInfo fromJson(JsonParser jsonParser) throws Exception {
        if (jsonParser.getCurrentToken() != JsonToken.START_OBJECT) {
            return null;
        }
        TileInfo tileInfo = new TileInfo();
        while (jsonParser.nextToken() != JsonToken.END_OBJECT) {
            String currentName = jsonParser.getCurrentName();
            jsonParser.nextToken();
            if ("rows".equals(currentName)) {
                tileInfo.rows = jsonParser.getIntValue();
            } else if ("cols".equals(currentName)) {
                tileInfo.cols = jsonParser.getIntValue();
            } else if ("dpi".equals(currentName)) {
                tileInfo.dpi = jsonParser.getIntValue();
            } else if ("format".equals(currentName)) {
                tileInfo.format = jsonParser.getText();
            } else if ("compressionQuality".equals(currentName)) {
                tileInfo.compressionQuality = jsonParser.getDoubleValue();
            } else if ("origin".equals(currentName)) {
                tileInfo.origin = (Point) d.d(jsonParser);
            } else if ("lods".equals(currentName)) {
                if (jsonParser.getCurrentToken() == JsonToken.START_ARRAY) {
                    tileInfo.lods = new ArrayList();
                    while (jsonParser.nextToken() != JsonToken.END_ARRAY) {
                        tileInfo.lods.add(LOD.fromJson(jsonParser));
                    }
                }
            } else if ("spatialReference".equals(currentName)) {
                tileInfo.spatialReference = SpatialReference.fromJson(jsonParser);
            } else {
                jsonParser.skipChildren();
            }
        }
        return tileInfo;
    }

    public String toString() {
        return "TileInfo [rows=" + this.rows + ", cols=" + this.cols + ", compressionQuality=" + this.compressionQuality + ", dpi=" + this.dpi + ", format=" + this.format + ", lods=" + this.lods + ", origin=" + this.origin + ", rows=" + this.rows + ", spatialReference=" + this.spatialReference + "]";
    }

    public int hashCode() {
        long doubleToLongBits = Double.doubleToLongBits(this.compressionQuality);
        long doubleToLongBits2 = Double.doubleToLongBits(this.dpi);
        int i = (((((this.cols + 31) * 31) + ((int) (doubleToLongBits ^ (doubleToLongBits >>> 32)))) * 31) + ((int) (doubleToLongBits2 ^ (doubleToLongBits2 >>> 32)))) * 31;
        String str = this.format;
        int hashCode = (i + (str == null ? 0 : str.hashCode())) * 31;
        List<LOD> list = this.lods;
        int hashCode2 = (hashCode + (list == null ? 0 : list.hashCode())) * 31;
        Point point = this.origin;
        int hashCode3 = (((hashCode2 + (point == null ? 0 : point.hashCode())) * 31) + this.rows) * 31;
        SpatialReference spatialReference = this.spatialReference;
        return hashCode3 + (spatialReference != null ? spatialReference.hashCode() : 0);
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && getClass() == obj.getClass()) {
            TileInfo tileInfo = (TileInfo) obj;
            if (this.cols == tileInfo.cols && Double.doubleToLongBits(this.compressionQuality) == Double.doubleToLongBits(tileInfo.compressionQuality) && Double.doubleToLongBits(this.dpi) == Double.doubleToLongBits(tileInfo.dpi)) {
                String str = this.format;
                if (str == null) {
                    if (tileInfo.format != null) {
                        return false;
                    }
                } else if (!str.equals(tileInfo.format)) {
                    return false;
                }
                List<LOD> list = this.lods;
                if (list == null) {
                    if (tileInfo.lods != null) {
                        return false;
                    }
                } else if (!list.equals(tileInfo.lods)) {
                    return false;
                }
                Point point = this.origin;
                if (point == null) {
                    if (tileInfo.origin != null) {
                        return false;
                    }
                } else if (!point.equals(tileInfo.origin)) {
                    return false;
                }
                if (this.rows != tileInfo.rows) {
                    return false;
                }
                SpatialReference spatialReference = this.spatialReference;
                if (spatialReference == null) {
                    if (tileInfo.spatialReference != null) {
                        return false;
                    }
                } else if (!spatialReference.equals(tileInfo.spatialReference)) {
                    return false;
                }
                return true;
            }
            return false;
        }
        return false;
    }
}
